package cn.yoho.im.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;

import javax.servlet.GenericServlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 群组服务
 * 
 * @author Hbomb
 * 
 */
public class GroupImServlet extends NormalImServlet {

    /**
   * 
   */
    private static final long serialVersionUID = -6090997130817639013L;

    /**
     * 调用转向
     */
    protected void rout(ServletRequest req, ServletResponse res)
            throws IOException {
        HttpServletRequest request = (HttpServletRequest) req;
        String m = request.getParameter("m");
        int methodCode = 0;
        if (m != null)
            methodCode = Integer.parseInt(m);
        switch (methodCode) {
        case 1:
            createGroup(req, res);
            break;
        case 2:
            delGroup(req, res);
            break;
        case 3:
            delGroupMember(req, res);
            break;
        case 4:
            addGroupMember(req, res);
            break;
        case 5:
            findGroup(req, res);
        case 6:
            GroupDetail(req, res);
            break;
        default:
            makeInfo(false, "非法请求!", req, res);
            break;
        }
    }

    /**
     * 创建群
     * 
     * @param req
     * @param res
     */
    private void createGroup(ServletRequest req, ServletResponse res) {

    }

    /**
     * 删除群
     * 
     * @param req
     * @param res
     */
    private void delGroup(ServletRequest req, ServletResponse res) {

    }

    /**
     * 删除群成员
     * 
     * @param req
     * @param res
     */
    private void delGroupMember(ServletRequest req, ServletResponse res) {

    }

    /**
     * 添加群成员
     * 
     * @param req
     * @param res
     */
    private void addGroupMember(ServletRequest req, ServletResponse res) {

    }

    /**
     * 查找群
     * 
     * @param req
     * @param res
     */
    private void findGroup(ServletRequest req, ServletResponse res) {

    }

    /**
     * 群详情
     * 
     * @param req
     * @param res
     */
    private void GroupDetail(ServletRequest req, ServletResponse res) {

    }
}
